﻿using HRMSystem.Wpf.WpfWindow;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace HRMSystem.Wpf.CompanyPages
{
    /// <summary>
    /// Interaction logic for add.xaml
    /// </summary>
    public partial class AddPage : Page
    {
        private static AddPage instance;

        public AddPage()
        {
            InitializeComponent();
            start_date.DisplayDateEnd = DateTime.Today;
        }

        public static AddPage Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new AddPage();
                }

                return instance;
            }
        }

        private void Save_Button_Click_1(object sender, RoutedEventArgs e)
        {
            DBServices.CompanyService.insertCompamy(name.Text, short_name.Text, reg_no.Text, Convert.ToDateTime(start_date.Text), vision.Text, mission.Text);
        }

        private void Cancel_Button_Click_1(object sender, RoutedEventArgs e)
        {
            CompanyPage.Instance.ContentFrame.Content = ViewPage.Instance;
        }
    }
}
